package org.hsieh.tr.explore;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.hsieh.tr.explore.ui.DatabaseViewer;
import org.hsieh.tr.explore.ui.SQLHistoryView;

public class PerspectiveFactory implements IPerspectiveFactory {

    private static final String STATE_VIEW_FOLDER = "stateViewFolder";

    public void createInitialLayout(IPageLayout layout) {
	String editorArea = layout.getEditorArea();
	layout.setEditorAreaVisible(true);
	layout.setFixed(true);

	layout.addStandaloneView(DatabaseViewer.ID, true, IPageLayout.LEFT,
		0.3f, editorArea);

	IFolderLayout stateAndHistoryFolder = layout.createFolder(
		STATE_VIEW_FOLDER, IPageLayout.BOTTOM, 0.75f, editorArea);

	stateAndHistoryFolder.addView(SQLHistoryView.ID);
	stateAndHistoryFolder.addView("org.eclipse.pde.runtime.LogView");
	stateAndHistoryFolder.addView("org.eclipse.ui.console.ConsoleView");
    }
}
